<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>资源获取</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="webjars/jquery/3.5.0/jquery.js"></script>
    <style type="text/css">
        div {
            padding: 0;
            margin: 0;
        }

        .div_select {
            width: 70%;
            float: left;
            margin-bottom: 35px;
        }

        .div_select1 {
            flex: 1;
            float: left;
            margin-left: 145px;
        }

        .div_show {
            width: 70%;
        }

        .div_showb {
            flex: 1;
            /*width: 35%;*/
            float: left;
            /*border: solid black 0.5px;*/
            /*margin-bottom: 35px;*/
            margin-left: 50px;
        }

        .div_showc {
            flex: 1;
            float: left;
            /*width: 35%;*/
            /*border: solid black 0.5px;*/
            margin-left: 50px;
        }
    </style>
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
    <div class="container">
        <div class="navbar-header">

            <a class="navbar-brand" href="#">数据集的查询系统后台</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a th:href="@{/user/listU}">用户管理</a></li>
                <li><a th:href="@{/user/book/listB}">书籍管理</a></li>
                <li><a th:href="@{/user/coursera/listC}">课程管理</a></li>
                <li class="active"><a th:href="@{select.html}">资源获取<span class="sr-only">(current)</span></a></li>
                <li><a th:href="@{/}">返回首页</a></li>
            </ul>
        </div><!--/.nav-collapse -->
    </div>
</nav>
<div>
    <div class="div_select">
        <div class="div_select1">
            <form action="login_success.html" th:action="@{/book/pa}" method="post" id="form_book"
                  name="form_book">

                <input class="itxt" type="text" placeholder="请输入地址" autocomplete="off" tabindex="1" name="bname"
                       id="bname"/>
                <br/>
                <br/>
                <input type="submit" value="爬取书籍" class="sub_btn" id="sub_b"/>
                <!--                    <input type="button" th:onclick="'javascript:isSubmitb();'" value="查询书籍">-->
            </form>
            <form action="login_success.html" th:action="@{/coursera/pa}" method="post" id="form_coursera"
                  name="form_book">

                <input class="itxt" type="text" placeholder="请输入地址" autocomplete="off" tabindex="1" name="cname"
                       id="cname"/>
                <br/>
                <br/>
                <input type="submit" value="爬取课程" class="sub_btn" id="sub_c"/>
                <!--                    <input type="button" th:onclick="'javascript:isSubmitb();'" value="查询书籍">-->
            </form>
        </div>
    </div>


    <div class="row div_show">
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main div_showb">
            <h2 class="sub-header" th:if="${not #lists.isEmpty(bookEntities)}">书籍获取</h2>
            <div class="table-responsive">
                <table class="table table-striped" th:if="${not #lists.isEmpty(bookEntities)}">
                    <thead>
                    <tr>
                        <th>图片：</th>
                        <th>书名：</th>
                        <th>链接：</th>
                        <th>作者：</th>
                        <th>价格：</th>
                        <th>所属类别：</th>
                    </tr>
                    </thead>
                    <tbody th:each="book:${bookEntities}">
                    <tr>
                        <td><span><img th:src="${book.getBImg()}"/></span></td>
                        <td><span th:text="${book.getBName()}"/></td>
                        <td><a th:text="书籍链接" th:href="${book.getBLink()}"/></td>
                        <td><span th:text="${book.getBAuthor()}"/></td>
                        <td><span th:text="${book.getBPrice()}"/></td>
                        <td><span th:text="${book.getBLevel()}"/></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main div_showc">
            <h2 class="sub-header" th:if="${not #lists.isEmpty(courseras)}">课程获取</h2>
            <div class="table-responsive">
                <table class="table table-striped" th:if="${not #lists.isEmpty(courseras)}">
                    <thead>
                    <tr>
                        <th>图片：</th>
                        <th>课程名：</th>
                        <th>所属大学：</th>

                        <th>链接：</th>
                        <th>所属类别：</th>
                    </tr>
                    </thead>
                    <tbody th:each="coursera:${courseras}">
                    <tr>
                        <td><img th:src="${coursera.getCImg()}"/></td>
                        <td><span th:text="${coursera.getCName()}"/></td>
                        <td><span th:text="${coursera.getCUniversity()}"/></td>
                        <td><a th:text="课程链接" th:href="'https://www.coursera.org'+${coursera.getCLink()}"/></td>
                        <td><span th:text="${coursera.getCLevel()}"/></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
</body>
</html>